﻿namespace ch10.binary
{
    public struct ConstData
    {
        public const uint FtTag = 0x60;
        public const uint FuncRef = 0x70;
        public const byte MutConst = 0;
        public const byte MutVar = 1;


        public const uint MagicNumber = 0x6D736100; // `\0asm`
        public const uint Version = 0x00000001; // 1

        public const byte ImportTagFunc = 0;
        public const byte ImportTagTable = 1;
        public const byte ImportTagMem = 2;
        public const byte ImportTagGlobal = 3;

        public const byte ExportTagFunc = 0;
        public const byte ExportTagTable = 1;
        public const byte ExportTagMem = 2;
        public const byte ExportTagGlobal = 3;


        public const byte SecCustomId = 0;
        public const byte SecTypeId = 1;
        public const byte SecImportId = 2;
        public const byte SecFuncId = 3;
        public const byte SecTableId = 4;
        public const byte SecMemId = 5;
        public const byte SecGlobalId = 6;
        public const byte SecExportId = 7;
        public const byte SecStartId = 8;
        public const byte SecElemId = 9;
        public const byte SecCodeId = 10;
        public const byte SecDataId = 11;

        public const int PageSize = 65536; // 64KB
        public const int MaxPageCount = 65536; // 2^16
    }
}